<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组状态检查</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 900px;
            margin: auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            margin-top: 40px;
        }
        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
        }
        form {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 30px;
        }
        form button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        form button:hover {
            background-color: #45a049;
        }
        .status-message {
            font-size: 1.2em;
            margin-top: 20px;
            padding: 15px;
            border-radius: 8px;
            border: 1px solid #ddd;
            background-color: #f9f9f9;
            text-align: center;
        }
        .status-message p {
            margin: 0;
            padding: 10px;
            background-color: #f1f1f1;
            border-radius: 4px;
        }
        .status-message p.success {
            background-color: #e8f5e9;
            color: #388e3c;
        }
        .status-message p.warning {
            background-color: #fff3e0;
            color: #fb8c00;
        }
        .status-message p.error {
            background-color: #ffebee;
            color: #e57373;
        }
        .status-message p.info {
            background-color: #e3f2fd;
            color: #1e88e5;
        }
        button.return-btn {
            background-color: #2196F3;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            display: block;
            margin: 20px auto 0;
            transition: background-color 0.3s;
            text-decoration: none;
            text-align: center;
        }
        button.return-btn:hover {
            background-color: #1976D2;
        }
        button.return-btn a {
            color: white;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>数组状态检查</h1>

        <!-- 检查数组 -->
        <form method="post">
            {% csrf_token %}
            <button type="submit">检查状态</button>
        </form>

        {% if result is not none %}
            <h2>数组状态检查结果：</h2>
            <div class="status-message">
                {% if result == 0 %}
                    <p class="info">状态：未排序</p>
                {% elif result == 1 %}
                    <p class="success">状态：升序</p>
                {% elif result == 2 %}
                    <p class="warning">状态：降序</p>
                {% elif result == 3 %}
                    <p class="success">状态：先升后降</p>
                {% elif result == 4 %}
                    <p class="warning">状态：先降后升</p>
                {% else %}
                    <p class="error">状态：未知</p>
                {% endif %}
            </div>
        {% endif %}

        <!-- 返回上一页按钮 -->
        <button class="return-btn"><a href="{% url 'experiment2' %}">返回上一页</a></button>
    </div>
</body>
</html>
